package org.lql.chaos.core.exception;

/**
 * @author: liangqinglong
 * @date: 2025-07-14 15:58
 * @description: 堆栈跟踪示例
 **/
public class StackTraceExample {

	public static void fe() {
		fd();
	}

	public static void fd() {
		fc();
	}

	public static void fc() {
		fb();
	}

	public static void fb() {
		fa();
	}

	public static void fa() {
		RuntimeException e = new RuntimeException("oops!");
		// 打印 stack trace
		StackTraceElement[] stackTrace = e.getStackTrace();
		for (StackTraceElement element : stackTrace) {
			System.out.println(element);
		}
		throw e;
	}

	public static void main(String[] args) {
		fe();
	}
}
